package com.sskj.functions.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.functions.activity.CurrentRecordActivity;
import com.sskj.functions.presenter.BasePresenter;
import com.sskj.lib.bean.CurrentRecordBean;
import com.sskj.lib.http.JsonCallBack;


/**
 * @author Hey
 * Create at  2019/07/05
 */
public class CurrentRecordPresenter extends BasePresenter<CurrentRecordActivity> {

    public void getRecord(int page, int size) {
        httpService.getRecordData(page,size)
                .tag(this)
                .execute(new JsonCallBack<HttpData<CurrentRecordBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<CurrentRecordBean>> response) {
                        CurrentRecordBean data = response.body().getData();
                        mView.getRecordSuccess(data);
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.onStoRefresh();
                    }
                });
    }
}
